package com.itcast.es.dao;

import com.itcast.es.model.CmsPage;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

import java.util.List;

public interface CmsPageRepository extends ElasticsearchRepository<CmsPage,String> {

    List<CmsPage> findByPageName(String pageName);//注意，方法中的参数个数必须与方法名称中findBy后面的属性个数相同

    List<CmsPage> findByPageNameLike(String pageName);

    Page<CmsPage> findByPageNameLike(String pageName, Pageable pageable);

}
